﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;
using System.Linq;
using System.Collections.ObjectModel;

namespace SignalLab
{
  public class SettingItemViewModel : ViewModelBase
  {
    public SettingItemViewModel() : base()
    {
      Items = new ObservableCollection<StringNameValue>();
    }

    public string SettingName
    {
      get { return _SettingName; }
      set
      {
        if (_SettingName != value)
        {
          _SettingName = value;
          RaisePropertyChanged("SettingName");
        }
      }
    }
    private string _SettingName;

    public string Key;

    public string Description
    {
      get { return _Description; }
      set
      {
        if (_Description != value)
        {
          _Description = value;
          RaisePropertyChanged("Description");
        }
      }
    }
    private string _Description;

    public ObservableCollection<StringNameValue> Items { get; set; }

    public StringNameValue GetItem(string key)
    {
      return Items.FirstOrDefault(i => i.Name == key);
    }
  }
}
